home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12060 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  34 lines

  1. Newsgroups: comp.lang.c++
  2. Path: in2.uu.net!world!news
  3. From: Chris Gould <slide@world.std.com>
  4. Subject: Casting pointer to member function to pointer to function
  5. Content-Type: text/plain; charset=us-ascii
  6. Message-ID: <314CD34A.7DBB@world.std.com>
  7. Sender: news@world.std.com (Mr Usenet Himself)
  8. Nntp-Posting-Host: world.std.com
  9. Content-Transfer-Encoding: 7bit
  10. Organization: The World @ Software Tool & Die
  11. Mime-Version: 1.0
  12. Date: Mon, 18 Mar 1996 03:06:50 GMT
  13. X-Mailer: Mozilla 2.0 (Win95; I)
  14.  
  15. Hi all,
  16.  
  17. I can't seem to get this to work and can't figure if it's even legal.  I 
  18. have a global function that takes as an argument a pointer to function. 
  19. The pointer to function is defined as 
  20.  
  21. long (__stdcall *)(void *,unsigned int,unsigned int,long)
  22.  
  23. I would like to pass a function that is a member of a class called CGWnd 
  24. to this function which would be defined as:
  25.  
  26. long (__stdcall CGWnd::*)(void *,unsigned int,unsigned int,long)
  27.  
  28. I've tried casting but but MSVC++ gives me an error that effectively 
  29. says I can't cast away the function's class membership.  Anyone know if 
  30. there is a way around this?
  31.  
  32. Thanks,
  33. Chris
  34.